﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Windows.Forms;

namespace MD5Checksum
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                bool isRecursive = Helper.IsContains(args, "-r") || Helper.IsContains(args, "-R");
                string resultText = Helper.GenerateMD5Checksum(isRecursive, 0, new string[0], ",", args);
                File.WriteAllText("md5checksum." + DateTime.Now.ToString("yyyyMMddHHmmss") + ".csv", resultText);
                return;

            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new UIForm());
        }
    }
}
